/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package swa.e_store.businessLogic;

import java.util.ArrayList;
import java.util.Date;
import swa.e_store.DTO.ArticleDTO;
import swa.e_store.DTO.AuthenticationDTO;
import swa.e_store.DTO.CustomerDTO;
import swa.e_store.DTO.CustomerReportDTO;
import swa.e_store.DTO.EmployeeDTO;
import swa.e_store.DTO.OfferDTO;
import swa.e_store.DTO.OrderDTO;
import swa.e_store.DTO.ShopReportDTO;
import swa.e_store.DTO.StockDTO;
import swa.e_store.entity.OrderItem;
import swa.e_store.entity.PurchaseItem;
//import swa.e_store.ENUM.EmployeeState;

/**
 *
 * @author Stefan
 */
public class BL_RemoteFacade implements BL_Interface {
    
    private BL_dtoFactory dtoFactory;
    
    public BL_RemoteFacade(){
    
        //dtoFactory erstellen.
        this.dtoFactory = new BL_dtoFactory();
    }

    @Override
    public ArticleDTO setPrice(int artNbr, long price, int USR) {
        BL_Article blArt = new BL_Article();
        blArt.setPrice(artNbr, price);
        //Emtpy Art. DTO. not supported yet.
        return new ArticleDTO();
    }

    @Override
    public OfferDTO createOffer(int artNbr, int amount, String dateFrom, String dateTo, int USR) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setOrder(ArrayList<OrderItem> orderItemList, int USRID, String date){
        BL_Order blOrder = new BL_Order();
        
        
        blOrder.placeReorder(orderItemList, USRID, date);
        
    }  

    @Override
    public ShopReportDTO getShopReport() {
        BL_Report blReport = new BL_Report();
        ShopReportDTO srDTO = blReport.createMonthlyReports();
        
        return srDTO;
    }

    @Override
    public CustomerReportDTO getCustomerReport(int CustomerNbr, String dateFrom, String dateTo) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public CustomerDTO getCustomerInfo(int customerNbr, int USR) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public EmployeeDTO getEmployeeInfo(int EmployeeNbr, int USR) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public AuthenticationDTO authenticate(String username, String password) {

        BL_Authentication auth = new BL_Authentication();
        return dtoFactory.createAuthenticationDTO(auth.authenticate(username, password));
    }

    @Override
    public ArticleDTO getArticleTable() {
        
        BL_Article blArticle = new BL_Article();
        ArticleDTO artDTO = blArticle.createArticleTable();
        
        return artDTO;
    }

    @Override
    public void setOffer(int artNbr, int offerId) {
        BL_Article blArticle = new BL_Article();
        blArticle.setOffer(artNbr, offerId);
    }

    @Override
    public OfferDTO getOfferTable() {
        BL_Article blArticle = new BL_Article();
        OfferDTO offerDTO = blArticle.createOfferTable();
        
        return offerDTO;
    }

    @Override
    public ArticleDTO getArticleTableByOffer(int offerId) {
        BL_Article blArticle = new BL_Article();
        ArticleDTO artDTO = blArticle.createArticleTableByOffer(offerId);
        
        return artDTO;
    }

    @Override
    public void setPurchase(ArrayList<PurchaseItem> purchaseItemList, int customoerId, String date) {
        BL_Order blOrder = new BL_Order();
        
        blOrder.setPurchase(purchaseItemList, customoerId, date);
    }

    @Override
    public StockDTO getStock() {
        
        BL_Stock blStock = new BL_Stock();
        return blStock.createStockTable();
    }
    
}
